Method: Vines::Router#<<

Defined in:
lib/vines/router.rb

#<<(stream) ⇒ Object

Add the connection to the routing table. The connection must return :client, :server, or :component from its stream_type method so the router can properly route stanzas to the stream.



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/vines/router.rb', line 51

def <<(stream)
  case stream_type(stream)
  when :client then
    return unless stream.connected?
    jid = stream.user.jid.bare
    @clients[jid] ||= []
    @clients[jid] << stream
  when :server then @servers << stream
  when :component then @components << stream
  end
end